package Work3;

import java.util.Scanner;

public class Pro1 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String name;
		int age;
		boolean sex;
		int n = in.nextInt();
		Person1 a[] = new Person1[n];
		for (int i = 0; i < n; i++) {
		    name = in.next();
		    age = in.nextInt();
		    sex = in.nextBoolean();
			 a[i] = new  Person1(name,age,sex);
		}
		for(int i = n-1; i >=0 ;i--)
			System.out.println(a[i]);
		System.out.println(new Person1());
	}
	
}
class Person1{
	private String name;
	private boolean gender;
	private int age;
	private int id;
	Person1(){
		System.out.println("This is constructor");
		System.out.println(name +"," + age +"," +
							gender + "," + id);
	}
	Person1(String name,int age,boolean gender){
		this.name = name;
		this.gender = gender;
		this.age = age;
	}
	@Override
	public String toString() {
		return "Person [name=" + this.name + ", age="
				+ this.age + ", gender=" +this.gender +
				", id=" + this.id +"]";
	}
	
	
}